package com.bytz.modules.cms.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bytz.modules.cms.order.entity.Order;
import com.bytz.modules.cms.order.entity.OrderDesignFlowRule;
import com.bytz.modules.cms.order.entity.OrderFlowRule;
import com.bytz.modules.cms.order.entity.OrderItem;
import com.bytz.modules.cms.order.model.AdminOrderModel;
import com.bytz.modules.cms.order.model.OrderItemModel;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 莱宝CMS—订单管理-订单主表 服务类
 * </p>
 *
 * @author KyleWang
 * @since 2022-10-10
 */
public interface IOrderFlowRuleService extends IService<OrderFlowRule> {



    /**
     * 计算所有脚本
     * @param order 订单
     * @param orderItems 订单项
     * @return 结果
     */
    Map<String, Boolean> runForFlow(AdminOrderModel order, List<OrderItemModel> orderItems);

    /**
     * 发布
     */
    void publish(List<OrderDesignFlowRule> allScripts);

    /**
     * 查询全部发布了的脚本
     * @return
     */
    List<OrderFlowRule> getAll();
}